package net.sunofbeach.blog.controller.user;

import lombok.extern.slf4j.Slf4j;
import net.sunofbeach.blog.pojo.SobUser;
import net.sunofbeach.blog.response.ResponseResult;
import org.springframework.web.bind.annotation.*;


@Slf4j
@RestController
@RequestMapping("/user")
public class UserApi {
    /*
    *  初始化管理员账号
    *
    * */
    @PostMapping("/admin_account")
    public ResponseResult initMangerAccount(@RequestBody SobUser sobuser){
        log.info("username == > " + sobuser.getUsername());
        log.info("password == > " + sobuser.getPassword());
        log.info("email == > " + sobuser.getEmail());
        return ResponseResult.SUCCESS();
    }

    @PostMapping
    public ResponseResult register(@RequestBody SobUser user){
        return null;
    }

    // 登录
    @PostMapping("/{captcha}")
    public ResponseResult login(@PathVariable("captcha") String captcha, @RequestBody SobUser user){
        return null;
    }


    // 获取图灵验证码
    @GetMapping("/{captcha}")
    public ResponseResult getCaptcha(){
        return null;
    }

    // 发送邮件
    @GetMapping("/verify_code")
    public ResponseResult sendVerifyCode(@RequestParam("email") String emailAddress){
        log.info("email == >" + emailAddress);
        return null;
    }


    // 修改密码
    @PutMapping("/password/{userId}")
    public ResponseResult updatePassword(@PathVariable("userId") String userId, @RequestBody SobUser user){
        return null;
    }


    // 获取作者信息
    @GetMapping("/{userid}")
    public ResponseResult getUserInfo(@PathVariable("userid") String userid){
        return null;
    }

    // 修改用户信息
    @PutMapping("/{userId}")
    public ResponseResult updateUserInfo(@PathVariable("userId") String userId, @RequestBody SobUser user){
        return null;
    }

    @GetMapping("/list")
    public ResponseResult listUsers(@RequestParam("page") int page, @RequestParam("size") int size){
        return null;
    }

    //删除用户
    @DeleteMapping("/{userId}")
    public ResponseResult deleteUser(@PathVariable("userId") String userid){
        return null;
    }

}
